from svglib.svglib import svg2rlg


def draw_linear_mito():
	with open('figure_scripts/figures/Figure4a_mtDNA.svg', 'w') as svg_output:
		svg_output.write('<svg height="250" width="1200" xmlns="http://www.w3.org/2000/svg">\n\n')
		svg_output.write('\n<!-- MARKERS -->\n')
		svg_output.write('<rect x="1113.8179733236768" y="100" height="40" width="36.182026676323176" style="fill:#ffcc00"></rect>')
		svg_output.write('<rect x="430.4091978996922" y="100" height="40" width="2.058060232965204" style="fill:#ffcc00"></rect>')
		svg_output.write('<rect x="50" y="100" height="40" width="38.30647594906151" style="fill:#ffcc00"></rect>')
		svg_output.write('<rect style="fill:#984ea3" x="93.02009777294948" y="100" height="40" width="171.41650069406722"></rect>')
		svg_output.write('<rect style="fill:#377eb8" x="432.4672581326574" y="100" height="40" width="672.3218057818817"></rect>')
		svg_output.write('<rect style="fill:#377eb8" x="269.415776449997" y="100" height="40" width="160.99342144969518"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="1104.7890639145392" y="100" height="40" width="9.028909409137668"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="1024.192769630032" y="100" height="40" width="4.846399903434076"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="855.830164765526" y="100" height="40" width="13.211418914841033"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="740.7779588387954" y="100" height="40" width="4.315287585249507"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="713.2928963727443" y="100" height="40" width="4.514454704568834"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="599.0373589232905" y="100" height="40" width="6.30695877844164"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="544.3327901502806" y="100" height="40" width="9.294465568229839"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="432.4672581326574" y="100" height="40" width="9.493632687549052"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="415.9363872291629" y="100" height="40" width="14.47281067052927"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="333.01647655259825" y="100" height="40" width="13.742531233025545"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="264.4365984670167" y="100" height="40" width="5.111956062526417"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="156.35524171645847" y="100" height="40" width="4.58084374434182"></rect>')
		svg_output.write('<rect style="fill:#ff7f00" x="88.30647594906151" y="100" height="40" width="4.713621823887976"></rect>')
		svg_output.write('<rect x="764.3460679582353" y="100" height="40" width="0.39833423863831285" style="fill:#ffcc00"></rect>')
		svg_output.write('<rect x="616.0993421449696" y="100" height="40" width="2.9875067897880854" style="fill:#ffcc00"></rect>')
		svg_output.write('<rect x="337.3981531776208" y="100" height="40" width="0.13277807954614218" style="fill:#ffcc00"></rect>')
		svg_output.write('<rect x="50" y="100" height="40" width="1100" stroke="black" strokewidth="1" fill="none"></rect>')
		svg_output.write('<rect x="50" y="100" height="20" width="1100" stroke="none" fill="#FFFFFF90" filter="url(#blurMe)"></rect>')
		svg_output.write('<rect x="50" y="100" height="10" width="1100" stroke="none" fill="#FFFFFFD0" filter="url(#blurMe)"></rect>')
		svg_output.write('<filter id="blurMe"><feGaussianBlur in="SourceGraphic" stdDeviation="6"></feGaussianBlur></filter>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="88.30647594906151" y1="100" x2="88.30647594906151" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="93.02009777294948" y1="100" x2="93.02009777294948" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="156.35524171645847" y1="100" x2="156.35524171645847" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="160.93608546080029" y1="100" x2="160.93608546080029" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="264.4365984670167" y1="100" x2="264.4365984670167" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="269.415776449997" y1="100" x2="269.415776449997" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="269.54855452954314" y1="100" x2="269.54855452954314" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="333.01647655259825" y1="100" x2="333.01647655259825" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="337.53093125716697" y1="100" x2="337.53093125716697" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="337.3981531776208" y1="100" x2="337.3981531776208" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="342.17816404128195" y1="100" x2="342.17816404128195" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="342.24455308105496" y1="100" x2="342.24455308105496" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="346.7590077856238" y1="100" x2="346.7590077856238" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="415.9363872291629" y1="100" x2="415.9363872291629" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="420.4508419337316" y1="100" x2="420.4508419337316" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="420.9155652121431" y1="100" x2="420.9155652121431" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="425.49640895648497" y1="100" x2="425.49640895648497" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="425.5627979962581" y1="100" x2="425.5627979962581" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="430.4091978996922" y1="100" x2="430.4091978996922" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="432.4672581326574" y1="100" x2="432.4672581326574" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="436.7825457179069" y1="100" x2="436.7825457179069" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="441.1642223429296" y1="100" x2="441.1642223429296" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="441.96089082020643" y1="100" x2="441.96089082020643" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="544.3327901502806" y1="100" x2="544.3327901502806" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="548.9136338946225" y1="100" x2="548.9136338946225" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="549.1128010139416" y1="100" x2="549.1128010139416" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="553.6272557185105" y1="100" x2="553.6272557185105" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="599.0373589232905" y1="100" x2="599.0373589232905" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="600.6970849176173" y1="100" x2="600.6970849176173" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="605.3443177017322" y1="100" x2="605.3443177017322" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="605.4107067415052" y1="100" x2="605.4107067415052" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="619.0868489347577" y1="100" x2="619.0868489347577" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="616.0993421449696" y1="100" x2="616.0993421449696" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="661.2438891906572" y1="100" x2="661.2438891906572" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="713.2928963727443" y1="100" x2="713.2928963727443" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="717.8073510773131" y1="100" x2="717.8073510773131" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="740.7779588387954" y1="100" x2="740.7779588387954" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="745.0932464240449" y1="100" x2="745.0932464240449" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="764.7444021968736" y1="100" x2="764.7444021968736" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="764.3460679582353" y1="100" x2="764.3460679582353" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="855.830164765526" y1="100" x2="855.830164765526" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="860.4110085098678" y1="100" x2="860.4110085098678" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="864.327961856479" y1="100" x2="864.327961856479" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="869.041583680367" y1="100" x2="869.041583680367" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="989.3385237491702" y1="100" x2="989.3385237491702" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="1024.192769630032" y1="100" x2="1024.192769630032" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="1028.7736133743738" y1="100" x2="1028.7736133743738" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="1029.039169533466" y1="100" x2="1029.039169533466" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="1104.7890639145392" y1="100" x2="1104.7890639145392" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="1109.1707405395618" y1="100" x2="1109.1707405395618" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="1109.303518619108" y1="100" x2="1109.303518619108" y2="140"></line>')
		svg_output.write('<line style="stroke:black;stroke-width:0.7" x1="1113.8179733236768" y1="100" x2="1113.8179733236768" y2="140"></line>')
		svg_output.write('<text x="90.63009234111897" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TF</text>')
		svg_output.write('<text x="124.65447522481743" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-RNR1</text>')
		svg_output.write('<line x1="90.63009234111897" y1="143" x2="90.63009234111897" y2="152" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="158.61246906874283" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TV</text>')
		svg_output.write('<text x="212.65314744402195" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-RNR2</text>')
		svg_output.write('<line x1="158.61246906874283" y1="143" x2="158.61246906874283" y2="152" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="266.8929929386203" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TL1</text>')
		svg_output.write('<text x="301.24932102118413" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ND1</text>')
		svg_output.write('<line x1="266.8929929386203" y1="143" x2="266.8929929386203" y2="152" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="320.2737039048826" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TI</text>')
		svg_output.write('<line x1="335.2737039048826" y1="143" x2="325.2737039048826" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="339.75496408956485" y="170" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TQ</text>')
		svg_output.write('<line x1="339.75496408956485" y1="143" x2="339.75496408956485" y2="161" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="359.46858591345284" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TM</text>')
		svg_output.write('<text x="381.3145029875068" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ND2</text>')
		svg_output.write('<line x1="344.46858591345284" y1="143" x2="354.46858591345284" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="399.1604200615607" y="160" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TW</text>')
		svg_output.write('<line x1="418.1604200615607" y1="143" x2="408.1604200615607" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="408.17279256442754" y="171" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TA</text>')
		svg_output.write('<line x1="423.17279256442754" y1="143" x2="418.17279256442754" y2="161" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="427.9528034280886" y="181" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TN</text>')
		svg_output.write('<line x1="427.9528034280886" y1="143" x2="427.9528034280886" y2="171" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="449.62490192528213" y="171" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TC</text>')
		svg_output.write('<line x1="434.62490192528213" y1="143" x2="439.62490192528213" y2="161" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="458.94018951053175" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TY</text>')
		svg_output.write('<text x="493.11364596535697" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-CO1</text>')
		svg_output.write('<line x1="438.94018951053175" y1="143" x2="448.94018951053175" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="531.5900175025649" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TS1</text>')
		svg_output.write('<line x1="546.5900175025649" y1="143" x2="536.5900175025649" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="568.3368338463395" y="171" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TD</text>')
		svg_output.write('<text x="576.299112801014" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-CO2</text>')
		svg_output.write('<line x1="551.3368338463395" y1="143" x2="561.3368338463395" y2="161" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="602.9875067897882" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TK</text>')
		svg_output.write('<line x1="602.9875067897882" y1="143" x2="602.9875067897882" y2="152" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="629.2487778381314" y="171" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ATP8</text>')
		svg_output.write('<line x1="612.2487778381314" y1="143" x2="622.2487778381314" y2="161" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="658.6716156678134" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ATP6</text>')
		svg_output.write('<text x="687.2351982618143" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-CO3</text>')
		svg_output.write('<line x1="638.6716156678134" y1="143" x2="648.6716156678134" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="710.5169292051421" y="159" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TG</text>')
		svg_output.write('<line x1="715.5169292051421" y1="143" x2="715.5169292051421" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="729.2594604381676" y="170" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ND3</text>')
		svg_output.write('<line x1="729.2594604381676" y1="143" x2="729.2594604381676" y2="161" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="747.9024081115336" y="159" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TR</text>')
		svg_output.write('<text x="766.9188243104593" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ND4L</text>')
		svg_output.write('<text x="810.0549218419941" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ND4</text>')
		svg_output.write('<line x1="742.9024081115336" y1="143" x2="742.9024081115336" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="843.0873921178104" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TH</text>')
		svg_output.write('<line x1="858.0873921178104" y1="143" x2="848.0873921178104" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="862.3362906632868" y="170" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TS2</text>')
		svg_output.write('<line x1="862.3362906632868" y1="143" x2="862.3362906632868" y2="161" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="881.6515782485365" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TL2</text>')
		svg_output.write('<text x="929.156859194882" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ND5</text>')
		svg_output.write('<text x="1006.7324521697145" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-ND6</text>')
		svg_output.write('<line x1="866.6515782485365" y1="143" x2="876.6515782485365" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="1026.4499969823164" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TE</text>')
		svg_output.write('<text x="1066.8809222041161" y="151" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-CYB</text>')
		svg_output.write('<line x1="1026.4499969823164" y1="143" x2="1026.4499969823164" y2="152" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="1091.946707707164" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TT</text>')
		svg_output.write('<line x1="1106.946707707164" y1="143" x2="1096.946707707164" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('<text x="1131.5275514515058" y="161" text-anchor="middle" style="fill: black; font-size:10; font-family:arial" alignment-base="middle">MT-TP</text>')
		svg_output.write('<line x1="1111.5275514515058" y1="143" x2="1121.5275514515058" y2="151" style="stroke:black; stroke-width:1"></line>')
		svg_output.write('</svg>')


if __name__ == "__main__":
	draw_linear_mito()
	figure = svg2rlg('figure_scripts/figures/Figure4a_mtDNA.svg')
